package com.cib.yym.homepage.common;

import com.cib.yym.homepage.common.impl.DefaultCacheManager;
import com.cib.yym.homepage.common.impl.GAECacheManager;

public class CacheManagerFactory {

	public static final String CACHE_TYPE_GAE = "GAE";
	public static final String CACHE_TYPE_DEFAULT = "HASHMAP";
	
	public static CacheManager getCacheManager() {
		String type = ConfigLoader.getInstance().getValue("cacheType");
		if(type.equals(CACHE_TYPE_DEFAULT))
		{
			return DefaultCacheManager.getInstance();
		}
		if(type.equals(CACHE_TYPE_GAE))
		{
			return GAECacheManager.getInstance();
		}
		return DefaultCacheManager.getInstance();
	}
	
}
